<script lang="ts" setup>
defineProps({
  item: {
    type: Object,
    required: true,
  },
});
</script>

<template>
  <template
    v-if="item.children && item.children.length > 0 && item.meta.alwaysShow"
  >
    <el-sub-menu index="">
      <template #title>
        <!-- <el-icon>
          <location />
        </el-icon> -->
        <span>{{ item.meta.title }}</span>
      </template>
      <templae v-for="childItem in item.children" :key="childItem.name">
        <el-menu-item v-if="childItem.meta.alwaysShow" :index="childItem.path"
          >{{ childItem.meta.title }}
        </el-menu-item>
      </templae>
    </el-sub-menu>
  </template>
  <el-menu-item :index="item.path" v-else-if="item.meta.alwaysShow">
    <!-- <el-icon>
      <icon-menu />
    </el-icon> -->
    <span>{{ item.meta.title }}</span>
  </el-menu-item>
</template>
